using Com.ContentRendering.Api.DataEngine.Exceptions;

namespace Com.ContentRendering.Api.DataEngine
{
    /// <summary/>
    public static class ValueReflection
    {
        /// <summary/>
        public static string Translate(object input)
        {
            // get the string value of the object
            string value = input.ToString();

            // if the value matches the type name then the value is invalid
            if (value == input.GetType().FullName)
            {
                throw new ObjectToStringInvalidException(value);
            }
            
            return value;
        }
    }
}
